﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Description>一般外键引用对象属性</Description>
            <Title>Rafy PropertyReference</Title>
            <Shortcut>RafyPropertyReference</Shortcut>
            <Author>HuQingfang</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>RefEntityType</ID>
                    <ToolTip>引用实体类型</ToolTip>
                    <Default>RefEntity</Default>
                </Literal>
                <Literal>
                    <ID>RefPropertyName</ID>
                    <ToolTip>引用实体属性名</ToolTip>
                    <Default>RefPropertyName</Default>
                </Literal>
                <Literal>
                    <ID>KeyType</ID>
                    <ToolTip>引用实体的标识类型。</ToolTip>
                    <Default>long</Default>
                </Literal>
                <Literal Editable="false">
                    <ID>ClassName</ID>
                    <Function>ClassName()</Function>
                    <Default>ClassNamePlaceholder</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[public static readonly IRefIdProperty $RefPropertyName$IdProperty =
            P<$ClassName$>.RegisterRefId(e => e.$RefPropertyName$Id);
        public $KeyType$ $RefPropertyName$Id
        {
            get { return ($KeyType$)this.GetRefId($RefPropertyName$IdProperty); }
            set { this.SetRefId($RefPropertyName$IdProperty, value); }
        }
        public static readonly RefEntityProperty<$RefEntityType$> $RefPropertyName$Property =
            P<$ClassName$>.RegisterRef(e => e.$RefPropertyName$, $RefPropertyName$IdProperty);
        /// <summary>
        /// $end$
        /// </summary>
        public $RefEntityType$ $RefPropertyName$
        {
            get { return this.GetRefEntity($RefPropertyName$Property); }
            set { this.SetRefEntity($RefPropertyName$Property, value); }
        }]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>